#! /usr/bin/env python
#coding=utf-8

import rospy


if __name__=="__main__":
    rospy.init_node("get_param_p")

    int_value = rospy.get_param("p_int",10000)
    double_value = rospy.get_param("p_double")
    bool_value = rospy.get_param("p_bool")
    string_value = rospy.get_param("p_string")
    p_list = rospy.get_param("p_list")
    p_dict = rospy.get_param("p_dict")



    rospy.loginfo("获取的数据:%d,%.2f,%d,%s",int_value,double_value,bool_value,string_value)
    

    for ele in p_list:
        rospy.loginfo("ele = %s", ele)

    
    rospy.loginfo("name = %s, age = %d", p_dict["name"],p_dict["age"])


    #get_param_cached

    #int_cached = rospy.get_param_cached("p_int")
    #rospy.loginfo("缓存数据：%d",int_cached)

    #get_param_names

    names = rospy.get_param_names()
    for name in names:
        rospy.loginfo("name = %s", name)

    rospy.loginfo("-"*80)


    #has_param
    flag = rospy.has_param("p_int")
    rospy.loginfo("包换p_int嘛？ %d", flag)


    #search_param

    key = rospy.search_param("p_int")
    rospy.loginfo("搜索的键 = %s", key)